package a.a;

import a.c.ab;
import a.c.d;
import a.c.e;
import a.c.n;
import a.c.q;
import a.c.v;
import a.c.w;
import a.c.*;
import a.c.z;

class lb
{
  q a;
  
  public boolean a(q paramq)
  {
    int j = m.b;
    boolean bool2 = m.a;
    this.a = paramq;
    a.i.y localy1 = new a.i.y(paramq);
    localy1.e();
    n localn = paramq.C();
    Object localObject = paramq.w();
    do
    {
      while (!bool2)
      {
        if (!((a.c.m)localObject).e()) {
          break;
        }
        localn.a(((a.c.m)localObject).a(), ((a.c.m)localObject).a().e());
        ((a.c.m)localObject).f();
      }
    } while (j != 0);
    localObject = m.d(paramq);
    a.i.y localy2 = new a.i.y(paramq);
    localy2.b();
    boolean bool1 = true;
    int i = 0;
    d locald;
    label200:
    do
    {
      if ((i >= localObject.length) || (!bool1)) {
        break;
      }
      locald = localObject[i];
      if (j == 0)
      {
        if (locald.size() >= 9)
        {
          a.i.y.a(paramq, locald.l());
          if (j == 0) {
            if (paramq.m() <= 3 * paramq.k() - 6)
            {
              bool1 = a();
              if ((j == 0) && (!bool2)) {
                break label200;
              }
            }
          }
          bool1 = false;
          a.i.y.b(paramq, locald.l());
        }
        i++;
      }
    } while (!bool2);
    localy2.g();
    a.c.m localm = paramq.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      locald = localm.a();
      if (j != 0) {
        break label310;
      }
      if (bool2) {
        break label308;
      }
      if ((e)localn.get(locald) != locald.e()) {
        paramq.e(locald);
      }
      localm.f();
    } while (!bool2);
    paramq.a(localn);
    if (j == 0) {
      localy1.g();
    }
    label308:
    label310:
    return bool1;
  }
  
  boolean a()
  {
    ab localab = c();
    if (m.b == 0) {
      if (localab.isEmpty()) {
        return true;
      }
    }
    return a(localab);
  }
  
  boolean a(ab paramab)
  {
    int i = m.b;
    boolean bool2 = m.a;
    g(paramab);
    a(">>>isPlanar");
    z localz = b(paramab);
    a.c.y localy = localz.h();
    do
    {
      do
      {
        if (!localy.e()) {
          break;
        }
        localObject = (i)localy.j();
        ((i)localObject).a(this.a);
        localy.f();
      } while (!bool2);
    } while (i != 0);
    boolean bool1 = true;
    Object localObject = localz.h();
    i locali;
    do
    {
      do
      {
        if (!((a.c.y)localObject).e()) {
          break;
        }
        locali = (i)((a.c.y)localObject).j();
        if (bool2) {
          break label200;
        }
        if (!locali.b())
        {
          locali.c(this.a);
          a("---findPath--");
          ab localab = f(paramab);
          bool1 = a(localab);
          locali.a(this.a);
          if (i == 0) {
            if (!bool1) {
              break;
            }
          }
        }
        else
        {
          ((a.c.y)localObject).f();
        }
      } while (!bool2);
    } while (i != 0);
    localObject = localz.h();
    label200:
    do
    {
      if (!((a.c.y)localObject).e()) {
        break;
      }
      locali = (i)((a.c.y)localObject).j();
      locali.c(this.a);
      ((a.c.y)localObject).f();
      if (i != 0) {
        break label309;
      }
      if (bool2) {
        return bool1;
      }
    } while (!bool2);
    if (i == 0)
    {
      if ((i != 0) || (bool1))
      {
        if (i == 0) {}
        bool1 = !a(localz, paramab);
      }
      g(paramab);
      a("<<<isPlanar " + bool1);
    }
    label309:
    return bool1;
  }
  
  boolean a(z paramz, ab paramab)
  {
    int i2 = m.b;
    boolean bool2 = m.a;
    q localq = new q();
    x localx = c(paramab);
    n localn = this.a.C();
    boolean bool1 = false;
    v localv = paramz.f();
    i locali1;
    do
    {
      do
      {
        if (localv == null) {
          break;
        }
        locali1 = (i)localv.c();
        locali1.a(localx, localn);
        if (i2 != 0) {
          break label102;
        }
        localv = localv.a();
        if (bool2) {
          break label100;
        }
      } while (!bool2);
    } while (i2 != 0);
    localv = paramz.f();
    label100:
    label102:
    if (localv != null) {}
    label127:
    do
    {
      locali1 = (i)localv.c();
      int i = -1;
      do
      {
        Object localObject2;
        int j;
        do
        {
          if (bool2) {
            break label808;
          }
          localObject1 = paramab.l();
          do
          {
            if (!((a.c.m)localObject1).e()) {
              break label300;
            }
            localObject2 = ((a.c.m)localObject1).a().e();
            j = 0;
            if (bool2) {
              break label127;
            }
            a.c.m localm1 = ((e)localObject2).l();
            do
            {
              do
              {
                if (!localm1.e()) {
                  break label232;
                }
                i locali2 = (i)localn.get(localm1.a());
                if (bool2) {
                  break;
                }
                if (locali2 == locali1)
                {
                  j = 1;
                  if (i2 != 0) {
                    break label239;
                  }
                  if (!bool2) {
                    break label232;
                  }
                }
                localm1.f();
              } while (!bool2);
            } while (i2 != 0);
            if (i2 == 0)
            {
              if (j != 0)
              {
                i++;
                localx.a(localObject2, i * 2);
              }
            }
            else
            {
              if (i2 != 0) {
                continue;
              }
              if (!bool2) {
                break label288;
              }
            }
            localx.a(localObject2, i * 2 + 1);
            ((a.c.m)localObject1).f();
          } while (!bool2);
        } while (i2 != 0);
        Object localObject1 = localv.a();
        do
        {
          if (localObject1 == null) {
            break label768;
          }
          localObject2 = (i)((v)localObject1).c();
          int k = -3;
          int m;
          int n;
          Object localObject3;
          int i1;
          do
          {
            m = i * 4 + 1;
            n = 0;
            if (bool2) {
              break label127;
            }
            a.c.m localm2 = ((i)localObject2).c();
            do
            {
              if (!localm2.e()) {
                break label599;
              }
              localObject3 = localm2.a();
              if (bool2) {
                break;
              }
              if (localx.get(((d)localObject3).e()) != null)
              {
                j = localx.getInt(((d)localObject3).e());
                if (i2 == 0) {
                  if (j < 0)
                  {
                    j = i * 2 + 1;
                    if (i2 != 0) {
                      break label478;
                    }
                    if (!bool2) {
                      break label462;
                    }
                  }
                }
                if (i2 == 0)
                {
                  if (j > 0)
                  {
                    if (i2 != 0) {
                      break label475;
                    }
                    if (j < i * 2) {
                      n = 1;
                    }
                  }
                  k = Math.max(k, j);
                }
                m = Math.min(m, j);
              }
              if ((i2 != 0) || (localx.get(((d)localObject3).f()) != null))
              {
                j = localx.getInt(((d)localObject3).f());
                if (i2 == 0) {
                  if (j < 0)
                  {
                    j = i * 2 + 1;
                    if (i2 != 0) {
                      break label585;
                    }
                    if (!bool2) {
                      break label569;
                    }
                  }
                }
                if (i2 == 0)
                {
                  if (j > 0)
                  {
                    if (i2 != 0) {
                      break label582;
                    }
                    if (j < i * 2) {
                      n = 1;
                    }
                  }
                  k = Math.max(k, j);
                }
                m = Math.min(m, j);
              }
              localm2.f();
            } while (!bool2);
            i1 = 0;
            if (i2 != 0) {
              break label679;
            }
          } while (i2 != 0);
          if ((k + 1) / 2 - m / 2 > 1)
          {
            if (i2 == 0) {
              if (m == 0)
              {
                if (i2 != 0) {
                  break label675;
                }
                if (k >= i * 2)
                {
                  if (i2 != 0) {
                    break label679;
                  }
                  if (n == 0) {
                    break label677;
                  }
                  i1 = 1;
                  if (i2 != 0) {
                    break label679;
                  }
                  if (!bool2) {
                    break label677;
                  }
                }
              }
            }
            i1 = 1;
          }
          if (i2 == 0)
          {
            if (i1 != 0)
            {
              localObject3 = locali1.a();
              if (i2 == 0) {
                if (localObject3 == null)
                {
                  localObject3 = localq.i();
                  locali1.a((e)localObject3);
                }
              }
              e locale = ((i)localObject2).a();
              if ((i2 != 0) || (locale == null))
              {
                locale = localq.i();
                ((i)localObject2).a(locale);
              }
              localq.a((e)localObject3, locale);
            }
            localObject1 = ((v)localObject1).a();
          }
        } while (!bool2);
        localv = localv.a();
      } while (i2 != 0);
      if (!bool2) {
        break;
      }
      this.a.a(localx);
    } while (i2 != 0);
    label232:
    label239:
    this.a.a(localn);
    label288:
    label300:
    label462:
    label475:
    label478:
    if (i2 == 0) {}
    label569:
    label582:
    label585:
    label599:
    bool1 = !c.a(localq);
    label675:
    label677:
    label679:
    label808:
    b(localq);
    label768:
    return bool1;
  }
  
  z b(ab paramab)
  {
    int i = m.b;
    boolean bool = m.a;
    z localz = new z();
    x localx = this.a.B();
    a.i.y localy = new a.i.y(this.a);
    Object localObject1 = paramab.l();
    do
    {
      do
      {
        if (!((a.c.m)localObject1).e()) {
          break;
        }
        localObject2 = ((a.c.m)localObject1).a();
        localx.a(((d)localObject2).e(), true);
        localy.a((d)localObject2);
        ((a.c.m)localObject1).f();
        if (i != 0) {
          break label126;
        }
        if (bool) {
          break label119;
        }
      } while (!bool);
    } while (i != 0);
    localObject1 = this.a.w();
    label119:
    label126:
    Object localObject3;
    do
    {
      if (!((a.c.m)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.m)localObject1).a();
      if (bool) {
        break label230;
      }
      if (i == 0)
      {
        if (localx.getBool(((d)localObject2).e()))
        {
          if (i != 0) {
            continue;
          }
          if (localx.getBool(((d)localObject2).f()))
          {
            localObject3 = new i();
            ((i)localObject3).a((d)localObject2);
            localy.a((d)localObject2);
            localz.c(localObject3);
          }
        }
        ((a.c.m)localObject1).f();
      }
    } while (!bool);
    label230:
    localObject1 = this.a.B();
    Object localObject2 = this.a.v();
    label509:
    do
    {
      if (!((w)localObject2).e()) {
        break;
      }
      localObject3 = ((w)localObject2).d();
      if ((i == 0) && (bool)) {
        return localz;
      }
      if (i == 0)
      {
        if (!localx.getBool(localObject3))
        {
          if (i != 0) {
            continue;
          }
          if (!((x)localObject1).getBool(localObject3))
          {
            ((x)localObject1).a(localObject3, true);
            a.c.bb localbb = new a.c.bb();
            i locali;
            do
            {
              localbb.b(localObject3);
              locali = new i();
              do
              {
                a.c.m localm;
                while (!localm.e())
                {
                  if (localbb.isEmpty()) {
                    break;
                  }
                  localObject3 = localbb.o();
                  locali.b((e)localObject3);
                  localm = ((e)localObject3).l();
                }
                d locald = localm.a();
                e locale = locald.a((e)localObject3);
                locali.a(locald);
                localy.a(locald);
                if (i != 0) {
                  break label509;
                }
                do
                {
                  if (bool) {
                    break;
                  }
                } while (i != 0);
                if (bool) {
                  break;
                }
                if (!localx.getBool(locale))
                {
                  if (i != 0) {
                    continue;
                  }
                  if (!((x)localObject1).getBool(locale))
                  {
                    ((x)localObject1).a(locale, true);
                    localbb.b(locale);
                  }
                }
                localm.f();
              } while (!bool);
            } while (i != 0);
            localz.c(locali);
          }
        }
        ((w)localObject2).f();
      }
    } while (!bool);
    localy.g();
    this.a.a((x)localObject1);
    if (i == 0) {
      this.a.a(localx);
    }
    return localz;
  }
  
  x c(ab paramab)
  {
    int i = m.b;
    boolean bool = m.a;
    x localx = this.a.B();
    do
    {
      a.c.m localm = paramab.l();
      while (!bool)
      {
        if (!localm.e()) {
          break;
        }
        if (bool) {
          break label70;
        }
        localx.a(localm.a().e(), true);
        localm.f();
      }
    } while (i != 0);
    label70:
    return localx;
  }
  
  public ab c()
  {
    int i = m.b;
    ab localab = f.a(this.a, false);
    if (i == 0)
    {
      if (localab.isEmpty()) {
        return localab;
      }
      e(localab);
    }
    z localz = b(localab);
    if (i == 0) {
      if (localz.size() == 0) {
        return new ab();
      }
    }
    if (localz.size() == 1) {
      return f(localab);
    }
    return localab;
  }
  
  void e(ab paramab)
  {
    int i = m.b;
    boolean bool = m.a;
    if (i == 0) {
      if (paramab.size() > 1)
      {
        d locald1 = (d)paramab.a(0);
        d locald2 = (d)paramab.a(1);
        if (i == 0)
        {
          if ((locald1.f() == locald2.f()) || (locald1.f() == locald2.e())) {
            a(paramab, locald1.e());
          }
        }
        else
        {
          if (i != 0) {
            break label98;
          }
          if (!bool) {
            return;
          }
        }
        a(paramab, locald1.f());
      }
    }
    label98:
    if (((i != 0) || (bool)) && (paramab.size() == 1)) {
      a(paramab, paramab.m().e());
    }
  }
  
  void a(ab paramab, e parame)
  {
    int i = m.b;
    boolean bool = m.a;
    a.c.m localm = paramab.l();
    Object localObject = localm.a();
    if (((d)localObject).e() != parame) {
      this.a.e((d)localObject);
    }
    localm.f();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      if (i == 0) {
        if (locald.e() != ((d)localObject).f()) {
          this.a.e(locald);
        }
      }
      localObject = locald;
      localm.f();
    } while (!bool);
  }
  
  ab f(ab paramab)
  {
    int i = m.b;
    boolean bool = m.a;
    Object localObject1 = null;
    Object localObject2 = null;
    Object localObject3 = paramab.f();
    if (localObject3 != null) {}
    label95:
    label100:
    label104:
    while (i != 0)
    {
      localObject4 = (d)((v)localObject3).c();
      localObject5 = ((d)localObject4).e();
      if (bool) {
        break label122;
      }
      if (i == 0)
      {
        if (((e)localObject5).c() > 2)
        {
          if (i == 0) {
            if (localObject1 == null)
            {
              localObject1 = localObject3;
              if (i != 0) {
                break label104;
              }
              if (!bool) {
                break label95;
              }
            }
          }
          if (i != 0) {
            break label100;
          }
          if (localObject2 == null) {
            localObject2 = localObject3;
          }
        }
        localObject3 = ((v)localObject3).a();
      }
      if (!bool) {
        break;
      }
    }
    label122:
    localObject3 = ((d)((v)localObject1).c()).e();
    Object localObject4 = ((d)((v)localObject2).c()).e();
    Object localObject5 = new a.i.y(this.a);
    Object localObject6 = paramab.l();
    do
    {
      if (!((a.c.m)localObject6).e()) {
        break;
      }
      d locald = ((a.c.m)localObject6).a();
      if (bool) {
        break label252;
      }
      if (i == 0) {
        if (this.a.j(locald)) {
          ((a.i.y)localObject5).a(locald);
        }
      }
      if ((i != 0) || ((((v)localObject1).c() != locald) && (((v)localObject2).c() != locald))) {
        ((a.i.y)localObject5).a(locald.e());
      }
      ((a.c.m)localObject6).f();
    } while (!bool);
    label252:
    localObject6 = bb.a(this.a, (e)localObject3, (e)localObject4, false);
    a((ab)localObject6, (e)localObject3);
    localObject1 = ((v)localObject1).b();
    if (localObject1 != null) {}
    while (i != 0)
    {
      if (i != 0) {
        break label360;
      }
      ((ab)localObject6).c(((v)localObject1).c());
      localObject1 = ((v)localObject1).b();
      if (bool) {
        break label358;
      }
      if (!bool) {
        break;
      }
    }
    if (localObject2 != null)
    {
      if (i == 0)
      {
        ((ab)localObject6).b(((v)localObject2).c());
        localObject2 = ((v)localObject2).a();
      }
    }
    else {
      for (;;)
      {
        if (!bool)
        {
          if (!bool) {
            break;
          }
          if (i == 0) {
            ((a.i.y)localObject5).g();
          }
        }
      }
    }
    label358:
    label360:
    return localObject6;
  }
  
  void a(String paramString) {}
  
  void g(ab paramab) {}
  
  void b(q paramq) {}
}



/* Location:           E:\idea\

 * Qualified Name:     a.a.lb

 * JD-Core Version:    0.7.0.1

 */